﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Axis.Web.Administrator.Global
{
    public class BasePage : System.Web.UI.MasterPage
    {
        public BasePage()
        {
            
            //
            // TODO: Add constructor logic here
            //
        }
        virtual protected bool AuthenticationRequired()
        {
            return CSecurity.SECRECT_TOKEN != null;

        }

        protected override void OnInit(EventArgs e)
        {
            if (AuthenticationRequired())
            {
                
                // 11/17/2007 Paul.  New function to determine if user is authenticated. 
                if (!CSecurity.IsAuthenticatedAdminPage())
                {
                    Response.Redirect("~/Administrator/Views/Login/Default.aspx");
                }
            }

            base.OnInit(e);
        }
    }

}